Skip to content

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Jul 26, 2025

review with whitespaces disabled, makes it obvious what changed

];
}

if (isset($args[0]) && (bool) $args[0]->getAttribute(ArrayFindArgVisitor::ATTRIBUTE_NAME)) {
Copy link
Contributor Author

@staabm staabm Jul 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already work on line 82 with $arrayMapArgs = $args[0]->value->getAttribute(ArrayMapArgVisitor::ATTRIBUTE_NAME); without a outer isset($args[0]), meaning the following isset checks are useless

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking more closely: we don't need the isset as we have an outer count($args) > 0

https://github.com/phpstan/phpstan-src/pull/4160/files#diff-c3b9f9c6c2992760688d174886d5d1ef9b5d4d1097b1175d6d5af43f9dc92192R79

@staabm staabm marked this pull request as ready for review July 26, 2025 08:20
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@staabm staabm force-pushed the simplify-pas branch 3 times, most recently from e270a17 to 67e9370 Compare August 5, 2025 08:34
@ondrejmirtes ondrejmirtes merged commit 4f321ba into phpstan:2.1.x Sep 2, 2025
444 of 452 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the simplify-pas branch September 2, 2025 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants